Secure File Store

A diagram of a protocol for authenticating messages using a MAC

A small API for a remote filesystem that allows for uploading/removing files, sharing files among users, and revoking access to shared files. Its main features are its security guarantees. Specifically, it offers confidentiality and integrity - in other words, data placed in the server is inaccessible to anyone other than its uploader and the people they shared it with, and only the original uploader and the people they shared it with should be able to modify a file.

The API supports initializing and loading users, storing and loading files, appending to files, sharing and receiving files, and revoking access to files.

As a slightly more granular look at the security guarantees offered, the API operates under the following assumptions:

With these conditions, we get the following guarantees:

One notable thing that is not guaranteed is rollback resistance - the data store or a malicious user may be able to revert a file to its previous version. If a user then tries to retrieve a file, they may receive an outdated version. This is a consequence of the data store being stateless. In an actual file store, this would not be acceptable, but for the purposes of this project it was a good enough compromise. The purpose of this project was mainly to see how cryptographic primitives may be used in an actual system, not implement one from scratch to use (which is almost universally a terrible idea when it comes to security).